#include "stdio.h"

int main(){

FILE *file = fopen("text.txt","r");

if(file == NULL){
    printf("打开文件失败\n");
}else{
    printf("打开文件成功\n");
}

int result = fclose(file);//关闭文件

if (result ==EOF)
{
    printf("关闭文件失败\n");
}else{
    printf("关闭文件成功\n");
}

return 0;
}